﻿{include file=header.html}
<script language="javascript" type="text/javascript" src="{res file=js/jquery-1.2.6.js}"></script>
<script language="javascript" type="text/javascript" src="{res file=js/common.js}"></script>
<style type="text/css">
#divButtonContainer1 {
float: left;
background: url(../../../../../includes/libraries/javascript/swfupload/images/btn.gif) no-repeat;
padding: 5px 0px 2px 2px;
width: 86px;
height: 28px;
}

div.upload_info{
	display:block;
	float:right;
	width:100px;
	height:20px;
	padding:5px;
	background-color:#3F6;
	display:none;
}

.sub-grid{
	width:360px;
	height:60px;
	}
</style>
{$editor_upload2}
{$editor_upload1}
<script type="text/javascript">
function add_uploadedfile(file_data)
{
	if(file_data.upload_type=="front_pic")
	{
		$(".front_pic_info").show();
		$("#front_pic").val(file_data.file_path);
		$("#front_pic_small").val(file_data.front_pic_small);
		
	}
	else
	{
		$(".other_pic_info").show();
		$("#other_pic").val(file_data.file_path);

	}
}

function submit_pic(){
	var id=$("#id").val();
	var front_pic=$("#front_pic").val();
	var other_pic=$("#other_pic").val();
	var front_pic_small=$("#front_pic_small").val();
	if(id=="0")
	{
		window.parent.get_sample_pics(front_pic,other_pic,front_pic_small);
	}
	else
	{
		window.parent.update_sample_pics(front_pic,other_pic,front_pic_small);
	}
}
</script> 
<body>
<form method="post" action="{url app=comupload&act=sample_pics}{if $smarty.get.id}&id={$smarty.get.id}{/if}" enctype="multipart/form-data">
<div class="sub-body upload_wrap" style="width:360px;">
  <h3 class="title-1">{$lang.upload_pic}</h3>
 <div>
 <span></span>
	<div id="divSwfuploadContainer">
    <div class="upload_info o_pic_info">
    <input type="hidden" name="o_pic" id="o_pic" value="" />
    <span></span></div>
	</div></div>
	
	<div class="sub-grid">
 <span>{$lang.front_pic}：</span>
	<div id="divSwfuploadContainer">
	<div id="divButtonContainer"><span id="spanButtonPlaceholder2"></span>
	</div>
    <div id="goods_upload_progress2"></div>
    <div class="upload_info front_pic_info">
        <input type="hidden" name="front_pic" id="front_pic" value="" />
         <input type="hidden" name="front_pic_small" id="front_pic_small" value="" />
    <span>{$lang.front_pic}已上传</span></div>
	</div></div>
	<p>&nbsp;</p>
    <p>&nbsp;</p>
 <div class="sub-grid">
 <span>{$lang.other_pic}：</span>
	<div id="divSwfuploadContainer">
	<div id="divButtonContainer"><span id="spanButtonPlaceholder1"></span>
	</div>
    <div id="goods_upload_progress1"></div>
   	<p>&nbsp;</p>
      <div class="upload_info other_pic_info">
      <input type="hidden" name="other_pic" id="other_pic" value="" />
      <span>{$lang.other_pic}已上传</span></div>

	</div>
 <input type="hidden" name="id" id="id" value="{$id}" />
 
 </div>

<br />
<div><!-- /* 提交按钮加入onClick="this.disabled='disabled'"，以防二次提交上传 */ -->
  <input style="margin-left: 49px;
margin-top: 30px;" type="button" class="btn-4" value="{$lang.submit}" onClick="submit_pic()" />
</div>
</div>
</form>
</body>
</html>
